﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShSoft.Infrastructure.EntityBase;

namespace WarehouseSystem.Domain.Entities
{
    /// <summary>
    /// 仓储区域
    /// </summary>
    public class StorageArea : AggregateRootEntity
    {
        #region  # 构造器

        #region 01.无参构造器
        /// <summary>
        /// 无参构造器
        /// </summary>
        protected StorageArea()
        {
        }

        #endregion

        #region 02.创建仓储区域构造器
        /// <summary>
        /// 创建仓储区域
        /// </summary>
        /// <param name="repertory">仓库</param>
        /// <param name="name">区域名称</param>
        public StorageArea(Repertory repertory,string name)
            : this()
        {
            this.Repertory = repertory;
            this.Name = name;
            //初始化关键字
            this.InitKeywords();
        }

        #endregion

        #endregion

        #region # 属性

        #region 导航属性  - 仓库 —— Repertory Repertory
        /// <summary>
        /// 导航属性 - 仓库
        /// </summary>
        public virtual Repertory Repertory { get; private set; }
        #endregion

        #endregion

        #region 方法

        //public

        #region 获取商品信息 ——



        #endregion

        //private

        #region 初始化关键字 —— void InitKeywords()
        /// <summary>
        /// 初始化关键字
        /// </summary>
        private void InitKeywords()
        {
            StringBuilder keywordsBuilder = new StringBuilder();
            keywordsBuilder.Append(base.Number);
            keywordsBuilder.Append(base.Name);

            base.SetKeywords(keywordsBuilder.ToString());
        }
        #endregion

        #endregion
    }
}
